﻿using EPiCode.GoogleMapsLocation;
using EPiServer.Labs.MobilePack.Site;
using System.Globalization;

namespace EPiServer.MobilePack.Templates.Location
{
    public partial class LocationItem : MobileBase
    {
        public string ClosestLocation
        {
            get
            {
                var location = CurrentPage["LocationInfo"] as GoogleMapsLocation;
                if (location != null)
                {
                    return location.Latitude.ToString(CultureInfo.InvariantCulture) + "," + location.Longitude.ToString(CultureInfo.InvariantCulture);
                }

                return "59.3239999,18.0753597";
            }
        }
    }
}
